var cradle = require('cradle'); 
var db = new(cradle.Connection)().database('hola'); 
db.save('_design/localidad', { 
        views: { 
                nusep_vista : { 
                        map: function(doc) { 
                                if (doc.i.placeName == 'Perillo') {       
				    emit(doc.i.placeName, doc);
				}
                        }
                }
	},
        lists: { 
		lista: function(head, req) { 
		    var row; 
		    start({ "headers": { "Content-Type": "text/html" } }); 
		    while(row = getRow()) { 
			send( "<li>" + row.value.i.placeName + ": " + row.value.i.lng + " , " + row.value.i.lat + "</li>\n" ); 
		    }
		}
	    }
});
